<script setup>
import { RouterView, RouterLink } from 'vue-router'
</script>

<template>
  <el-container class="header-and-main">
    <el-header height="30">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/index' }">回到主页</el-breadcrumb-item>
        <el-breadcrumb-item>
          <a href="/">promotion management</a>
        </el-breadcrumb-item>
        <el-breadcrumb-item>promotion list</el-breadcrumb-item>
        <el-breadcrumb-item>promotion detail</el-breadcrumb-item>
      </el-breadcrumb>
    </el-header>
    <el-main>
      <div class="container">
        <div class="xtx-member-aside">
          <div class="user-manage">
            <h4>我的账户</h4>
            <div class="links">
              <RouterLink to="/personalCenter/userInfo" style="text-decoration: none"
                >个人中心</RouterLink
              >
            </div>
            <h4>交易管理</h4>
            <div class="links">
              <RouterLink to="/personalCenter/order" style="text-decoration: none"
                >我的订单</RouterLink
              >
            </div>
          </div>
        </div>
        <div class="article">
          <!-- 三级路由的挂载点 -->
          <RouterView />
        </div>
      </div>
    </el-main>
  </el-container>
</template>

<style scoped lang="scss">
.header-and-main {
  flex-direction: column;
}

.container {
  display: flex;
  padding-top: 20px;

  .xtx-member-aside {
    width: 18%;
    margin-right: 20px;
    border-radius: 2px;
    background-color: #e9e9eb;

    .user-manage {
      background-color: #e9e9eb;

      h4 {
        font-size: 18px;
        font-weight: 400;
        padding: 20px 52px 5px;
        border-top: 1px solid #f6f6f6;
      }

      .links {
        padding: 0 52px 10px;
      }

      a {
        display: block;
        line-height: 1;
        padding: 15px 0;
        font-size: 14px;
        color: #666;
        position: relative;

        &:hover {
          color: #194;
        }

        &.active,
        &.router-link-exact-active {
          color: rgb(69, 17, 153);

          &:before {
            display: block;
          }
        }

        &:before {
          content: '';
          display: none;
          width: 6px;
          height: 6px;
          border-radius: 50%;
          position: absolute;
          top: 19px;
          left: -16px;
          background-color: rgb(135, 153, 17);
        }
      }
    }
  }

  .article {
    width: 80%;
    height: 100%;
    background-color: #fff;
  }
}
</style>
